package ca.usask.cs.decisiontree.api;

import java.util.Iterator;


/**
 * An IntermediateTreeNode is a TreeNode that may also have children connected by Edges.
 * 
 * @author SaskTrav
 */
public interface IntermediateTreeNode extends Node {
    
    /**
     * Remove an Edge from this node to disconnect a child. If the Edge does not exist, do nothing.
     * Note: No exception is thrown if the Edge was not a child, as the removal is considered successful.
     * 
     * @postcondition iterator returned from getChildren will not contain childToRemove
     * 
     * @param childToRemove An Edge to attempt to remove from this node.
     * @see Edge
     */
    public boolean removeChildEdge(Edge childToRemove);

        /**
     * Adds an Edge to this node to connect a child. If the Edge already exists
     * in the node, do nothing.
     *
     * @postcondition iterator returned from getChildren will contain childToAdd
     *
     * @param childToAdd An Edge to be added to this node
     * @return
     */
    public boolean addChildEdge(Edge childToAdd);
    
    /**
     * Retrieve the Edges which are children of this node.
     * 
     * @return An Iterator over Edges which have this node as their Source.
     * @see Iterator
     * @see Edge
     */
    public Iterator<Edge> getChildEdgeList();

            
}
